package lib

import (
	"github.com/gin-gonic/gin"
)

type RouterGroup struct {
	*gin.RouterGroup
}

func (r *RouterGroup) Group(relativePath string, handlers ...ContextOptionFunc) *RouterGroup {
	rHandlers := TransHandlerFunc(handlers...)
	return &RouterGroup{r.RouterGroup.Group(relativePath, rHandlers...)}
}

func (r *RouterGroup) Use(middlewares ...ContextOptionFunc) gin.IRoutes {
	rHandlers := TransHandlerFunc(middlewares...)
	return r.RouterGroup.Use(rHandlers...)
}

func (r *RouterGroup) GET(relativePath string, handlers ...ContextOptionFunc) gin.IRoutes {
	rHandlers := TransHandlerFunc(handlers...)
	return r.RouterGroup.GET(relativePath, rHandlers...)
}

func (r *RouterGroup) POST(relativePath string, handlers ...ContextOptionFunc) gin.IRoutes {
	rHandlers := TransHandlerFunc(handlers...)
	return r.RouterGroup.POST(relativePath, rHandlers...)
}

func (r *RouterGroup) Any(relativePath string, handlers ...ContextOptionFunc) gin.IRoutes {
	rHandlers := TransHandlerFunc(handlers...)
	return r.RouterGroup.Any(relativePath, rHandlers...)
}

func (r *RouterGroup) HEAD(relativePath string, handlers ...ContextOptionFunc) gin.IRoutes {
	rHandlers := TransHandlerFunc(handlers...)
	return r.RouterGroup.HEAD(relativePath, rHandlers...)
}

func (r *RouterGroup) DELETE(relativePath string, handlers ...ContextOptionFunc) gin.IRoutes {
	rHandlers := TransHandlerFunc(handlers...)
	return r.RouterGroup.DELETE(relativePath, rHandlers...)
}

func (r *RouterGroup) OPTIONS(relativePath string, handlers ...ContextOptionFunc) gin.IRoutes {
	rHandlers := TransHandlerFunc(handlers...)
	return r.RouterGroup.OPTIONS(relativePath, rHandlers...)
}

func (r *RouterGroup) PATCH(relativePath string, handlers ...ContextOptionFunc) gin.IRoutes {
	rHandlers := TransHandlerFunc(handlers...)
	return r.RouterGroup.PATCH(relativePath, rHandlers...)
}
func (r *RouterGroup) PUT(relativePath string, handlers ...ContextOptionFunc) gin.IRoutes {
	rHandlers := TransHandlerFunc(handlers...)
	return r.RouterGroup.PUT(relativePath, rHandlers...)
}

func (r *RouterGroup) Handle(httpMethod string, relativePath string, handlers ...ContextOptionFunc) gin.IRoutes {
	rHandlers := TransHandlerFunc(handlers...)
	return r.RouterGroup.Handle(httpMethod, relativePath, rHandlers...)
}
